/*
 * @Author: szx
 * @Date: 2021-10-30 11:39:49
 * @LastEditTime: 2021-10-30 11:46:42
 * @Description:
 * @FilePath: \leetcode\136\136.cpp
 */
#include <iostream>
#include <vector>
using namespace std;
class Solution {
   public:
    int singleNumber(vector<int>& nums) {
        int n = nums[0];
        for (int i = 1; i < nums.size(); i++) {
            n ^= nums[i];
        }
        return n;
    }
};